﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x804 上介绍了“空白页”项模板

namespace Manga
{
    using System.Collections.ObjectModel;
    using System.ComponentModel;

    public class NavItem
    {
        public object Icon { get; set; }
        public object Label { get; set; }
        public Type Uri { get; set; }
    }
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class MainPage : Page,INotifyPropertyChanged
    {
        public MainPage()
        {
            this.InitializeComponent();
            
        }

        private void OnNavBarSelectedNewItem(object sender,SelectionChangedEventArgs e)
        {
            var NavBar = sender as ListBox;
            var NavItem = NavBar.SelectedItem as NavItem;
            System.Diagnostics.Debug.WriteLine(NavItem.Uri);
        }
        private ObservableCollection<NavItem> _NavCollection = new ObservableCollection<NavItem>()
            {
                new NavItem(){
                    Icon = "\uE13D",
                    Label = "个人中心",
                    Uri=typeof(Contents.Index)
                },
                new NavItem(){
                    Icon = "\uE10F",
                    Label = "首页",
                    Uri=typeof(Contents.Index)
                },new NavItem(){
                    Icon = "\uE118",
                    Label = "下载中心",
                    Uri=typeof(Contents.Download)
                },
            };

        public event PropertyChangedEventHandler PropertyChanged;

        public ObservableCollection<NavItem> NavCollection {
            get { return _NavCollection; }
            set { _NavCollection = value; }
        }
    }
}
